% !TeX encoding=utf8
% !TeX spellcheck = en-US
% =========================================================================
\chapter{Introduction}

This chapter gives a general introduction to the usage of this template and enables the user to start with the actual work. 
In the subsequent chapters and other parts of this documentation you will find a wide variety of further information. However, there is no need to read them all. Instead you might find it useful to look at individual sections later, when you are looking specifically for a solution to a problem.

The latest changes in the template are shortly presented in the first \cref{sec:doc:changes}. The full history can be found in \cref{appendix:doc:changes}.

In the second \cref{sec:doc:targetusers} you find a general discussion on the typical user of this template followed by a tutorial (\cref{sec:doc:start}) on how to start working with this template. The chapter ends with the introduction of magic comments in \cref{sec:doc:magiccomments}.

In the next \cref{chap:doc:faq} you will find a list of typical questions and answers that are specific for this template followed by a list of known problems in this template (\cref{chap:doc:problems}). For those who want to change the font in the template there is a short overview on fonts provided in \cref{chap:doc:fonts}.
% -------------------------------------------------------------------------
\section{Changes in the latest release}
\label{sec:doc:changes}

These changes were introduced in the latest release:

\minisec{2014/07 v3.2.2} %
Bug fixes, Improvements and other changes
\begin{itemize}
\item The template failed to compile with TeX Live 2014. The error was in the definition of \cs{addmoretexcs}. 
\item The options of \package{geometry} were not well thought out. If a spacing factor was introduced this could lead to an ugly page layout. All options of \package{geometry} are now such that the page layout is similar to the one of \package{typearea} with DIV12. 
\item The publications lists are now bibliography lists create with \cs{printbibliography}. Previously these needed to be created completely manual.
\item New magic comment for the bibliography tool added.
\item Removed packages. These are now available from CTAN or better the distribution package manager. 
\end{itemize}

See \cref{appendix:doc:changes} for all full list of the previous development process of this template.
% -------------------------------------------------------------------------
\section{Target Users}
\label{sec:doc:targetusers}

This template was developed with all sorts of structured documents in mind that require a good citation and reference framework with a customizable layout. It has so far been used for bachelor, master and phd-thesis as well as the thesis of teachers in their practical year. These theses had all a natural science background, which means that also this template is optimized for the needs of people in natural sciences. Nevertheless it should be easily adaptable to topics in humanities, linguistics or even arts.

Since the code is rather complex one might have objections against this template. Here is a list why there is nevertheless a benefit for all sorts of users.

\begin{description}
\item[Beginners] have the advantage of a ready to use template that covers all major topics. They do not have to load packages therefore and do not need to fiddle with the preamble. This especially saves a lot of time. If the rare case should happen that a modification is necessary the preamble is very well documented. Typical configurations are listed in \cref{sec:doc:config:latex}.

The other aspect very valuable for beginners is the large list of example codes in \cref{part:demo}. 
%
\item[Advanced \latex users] benefit from all aspects that are listed above for beginners. Furthermore they can make use of all functions and documentation of this template for simple up to extensive modifications. \Cref{sec:doc:features} provides useful information for a start.

Complete different layouts created by significant changes in \file{preamble/style.tex} and subsequent files could be send to the maintainer of this template for a review and possibly an integration into the template. The same applies for users, who add new functionality to the template that might also be of interest for other users.
%
\item[Package authors] can also benefit from this template. The development has shown that it is a valuable project for finding incompatibilities between different packages and for testing of packages in general in a large and complex, but yet realistic project. 
\end{description}

This template and its predecessor has been used under the supervision of the maintainer by very early beginners and also advanced \latex users. The experience was that beginners as well as advanced users are more productive with it because \enquote{it just works}, while the more advanced users additionally know that they can find all options for later modifications because of the code documentation. And some even find bugs \ldots.

% -------------------------------------------------------------------------
\section{Features of the template}
\label{sec:doc:features}

This section is structured as follows: \cref{sec:doc:features:template} describes the features and advantages of the template in general, whereas \cref{sec:doc:features:doc} summarizes the possibilities for the creation of a document. The subsequent sections provide additional information.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Template features}
\label{sec:doc:features:template}
This template provides a great variety of functionality for creating complex and demanding documents for the user, see \cref{sec:doc:features:doc}. To provide these the template itself is designed with some special respects:

% .........................................................................
\subsubsection{Separation between function and layout}
\label{sec:doc:features:template:sep}
The packages (functions) are loaded separated from the layout. This makes it possible the exchange the layout of the document while keeping all functionality and makes it easier to test problem without customizations in the layout.

This principle is realized by loading all packages in the file \file{preamble/packages.tex} and all layout modifications in \file{preamble/style.tex} and its subsequent files. The only exceptions are packages that are necessary for the template itself and packages that should be configured before using the template, see \cref{sec:doc:config:editor}
%
% .........................................................................
\subsubsection{Documentation of the code}
\label{sec:doc:features:template:doc(code)}
All code was included with a minimal documentation. Packages are loaded with a short description and important information about package loading orders (if necessary). The code of the style modifications is also documented to some extent. If a certain code segment should be incomprehensible this should be reported as a bug.

% .........................................................................
\subsubsection{Extensive options}
\label{sec:doc:features:template:options}
Many packages provide a large number of options. This often means that one has to check the documentation several times for all modifications of the package configuration. To simplify this process this template tries to include all options of a package with a minimal description for each option. This itself is somehow a minimal documentation of a package.

% .........................................................................
\subsubsection{Comprehensive documentation}
\label{sec:doc:features:template:doc(template)}
The documentation of this template is very comprehensive. The code itself is documented as much as possible and necessary. Furthermore this documentation document provides an overview of the features and configuration possibilities (\cref{part:documentation}), a large collection of \latex application examples (\cref{part:demo}) and a complete printout of the code of the template (\cref{part:code}).

% .........................................................................
\subsubsection{Solving Incompatibilities and fixing bugs}
\label{sec:doc:features:template:bugs}
Incompatibilities between packages are take into consideration by putting all packages in the correct loading order and by preventing packages to load if this would raise an error.

This is achieved mainly by using commands like \cs{IfPackageLoaded}, \cs{IfPackagesNotLoaded}, \cs{ExecuteAfterPackage}, \cs{IfFileExists}, \cs{IfMultDefined} and others mostly defined by the package \package{templatetools}. 

The goal is to let the whole document compile without the inclusion of \file{preamble/style.tex} and as much as possible to compile without the loading of any or most packages in file \file{preamble/packages.tex}.

Furthermore the template tries to fix bugs that do not get solved by the package authors. This requires, however, that the problems and its solutions are known. Anyway, this only applies to bugs that do not get solved. In principle all bugs that are encountered are reported to the package authors.
It may happen that a bug fix in this template has become obsolete because it was in the meantime fixed in the package. In that case please inform the template maintainer.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Document features}
\label{sec:doc:features:doc}
This template provides all methods (commands, environments, work flows) that are required for a complex scientific document. This is realized by loading a large number of relevant and modern packages of \latex. It is difficult to provide a complete list of the resulting features therefore the following lists include only a subset of the most interesting ones.

% .........................................................................
\subsubsection*{General}
\begin{itemize}
\item Automatic detection of document encoding (\package{selinput}).
\item Support for files with multiple dots, special characters and other pitfalls (\package{grffile}).
\end{itemize}

% .........................................................................
\subsubsection*{Math and scientific notations}
\begin{itemize}
\item Professional math typesetting with a large number of supported symbols and commands using \package{amsmath}, \package{mathtools} and others.
%
\item Professional display of scientific notations with automated processing of numbers and units and therefor consistent typesetting (\package{siunitx})
%
\end{itemize}

% .........................................................................
\subsubsection*{Text typesetting}
\begin{itemize}
\item Multi language support with automatic hyphenation (\package{babel})
%
\item Customizable item and enumeration lists (\package{enumitem})
%
\item Multiple highlighting possibilities (\package{ulem}, \package{soul})
%
\item Correct and save display of urls and file path (\package{url})
\end{itemize}


% .........................................................................
\subsubsection*{References}
\begin{itemize}
\item Enhanced cross-referencing with automatical determination of the type (equation, section, etc.) (\package{cleveref}, \package{varioref})
\end{itemize}


% .........................................................................
\subsubsection*{Figure, Images, placement and captions}
\begin{itemize}
%
\item Image inclusion (\package{graphicx})
\item Figure positioning (\package{flafter}, \package{placeins})
\item Placement of images in inside a paragraph (\package{wrapfig})
\item Automatic conversion from eps to pdf (\package{epstopdf})
\item Customizable layout of the captions (\package{caption})
\item Parallel and stacked layout of multiple images in a single figure with sub-captions (\package{subcaption}, \package{floatrow})
%
\end{itemize}

% .........................................................................
\subsubsection*{Diagrams and scientific plots}
\begin{itemize}
\item Vector graphics with all features of a professional vector graphics program (\package{pgf}, \package{tikz})
%
\item High quality vector based function or data plots in normal or logarithmic scaling (\package{pgfplots}, \package{pgfplotstable})
\end{itemize}

% .........................................................................
\subsubsection*{Tables}
\begin{itemize}
\item Tables with the ability to create them with a professional design (\package{booktabs}, \package{tabu}, \package{xcolor}),
%
\item Table columns with variable width (so called \enquote{X} columns) and line break support (\package{tabularx}, \package{tabu}),
%
\item Multi page tables (\package{tabu}, \package{ltxtable}),
\end{itemize}

% .........................................................................
\subsubsection*{Citations and Quotes}
\begin{itemize}
\item Bibliographies and Citations with highly customizable layout with all settings done in \latex code. This bibliography system is not only highly customizable but also programmed for the most advanced demands (\package{biblatex}). 
 
Note that all previous packages for bibliographies are incompatible because all their functionality was comprehended in this new package. 
%
\item Quotations are typeset in the format of the current language and automatically converted from inline to block quotes. The display of these quotes is customizable (\package{csquotes}).  
\end{itemize}

% .........................................................................
\subsubsection*{Index, Glossary, Acronym list, Symbol list}
\begin{itemize}
\item The index created with this template can be modified in several ways and the necessary calls to external programs are automatically done. (\package{imakeidx}).   
%
\item Several other lists such as Glossary, Acronym list and a Symbol list can be created and special themes for the display are available and can be modified and extended (\package{glossaries}).
\end{itemize}

% .........................................................................
\subsubsection*{Code display with syntax highlighting}
\begin{itemize}
\item Source code can be displayed with word list based syntax highlighting (\package{listings}).
\end{itemize}

% .........................................................................
\subsubsection*{Layout}
\begin{itemize}
\item Most aspects of the layout can be modified due the base classes from koma-script. 
%
\item The line spacing can be adjusted in one-half, double or custom spacing (\package{setspace}).
%
\item Head and Foot have automatic generated content which can be customized together with the layout of the header and footer (\package{scrpage2}).
%
\item The Heading can be fully customized. In this template by default the chapter layout is changed with the provided functions (\package{titlesec}).
%
\item The page size can be calculated automatically (\package{typearea}) or defined in every tiny detail (\package{geometry}).
%
\item Many further items can be modified with commands provided by \latex itself or any of the packages loaded. All customizations of the layout are done in the file \file{preamble/style.tex}.
\end{itemize}

% .........................................................................
\subsubsection*{PDF Features}
\begin{itemize}
\item Inclusion of complete or partial pdf documents as full pages (\package{pdfpages}).
%
\item hyperlinks for all references and citations with backlinks (\package{hyperref}).
%
\item Bookmarks in the pdf document (\package{bookmark}).
\end{itemize}

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Speed of compilation}
Since the preamble of this template is much longer than most other templates the compilation time of the preamble is consequently also longer. This view however is misleading. The compilation time is in the range of 2 to 4 seconds for the preamble\footnote{Measured on a Windows System (7, 64 bit) with Intel i5 processor and the file system on a SSD. The times for a standard magnetic hard disk should not differ much, since the files are in the memory cache anyway.}, however a real document (like a master thesis) with many pictures takes much longer. The templates main file takes about 7 seconds with very few pages. The template documentation with above 200 pages and many pictures takes more than 40 seconds. My own phd-thesis took minutes to compile due to many high resolution pictures. The compilation time of the preamble therefore is in reality negligible or in other words, even though this templates preamble is quote complex it compile fast enough.

The concrete times of each part of the preamble are displayed in \cref{fig:doc:executiontimes}. The code was executed several times and the average of the last three runs was used. This ensures that all files are in the cache of the hard disk or system memory. The execution time was measured with a batch script based on code from \href{http://stackoverflow.com/questions/4313897/timer-in-dos-batch-file}{stackoverflow.com}. 

The direct visible result of this survey is, not very surprisingly, that the most complex packages such as \package{amsmath}, \package{biblatex}, \package{glossaries}, \package{listings}, \package{hyperref} consume most of the time. The loading of \package{pgf}, \package{tikz} and \package{pgfplots} stands out with more than 1000\,ms. This can be reduced by removing unused libraries or removing these packages completely, if they are not required.

\begin{figure}[p]
\input{doc/plot.executiontimes.tex}
\caption[Execution times of the template divided into compilation steps]{Execution times of the template divided into compilation steps. The largest execution times come from the major packages. The packages loaded in each step are listed in \cref{tab:doc:packages}. Note that these times were measured with the packages loaded by the version of January 2013.}
\label{fig:doc:executiontimes}
\end{figure}



% -------------------------------------------------------------------------
\section{Tutorial - how to start}
\label{sec:doc:start}

If you want to use this template for your work you should follow these three steps to configure everything for your needs.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Configure Editor and System Settings}
\label{sec:doc:config:editor}

The template needs to be configured for editor and system specific settings such as the encoding of the documents and the encoding of the file system. Both are configured in the main file in the section called \emph{encoding}.
These settings must be configured to ensure that special characters such as: äüößêì are shown correct in the editor and the output pdf-file.

The encoding of the editor must be configured in the editor its self or be set up with magic comments, see \cref{sec:doc:magiccomments:encoding}. Anyway, the setting should typically be set up as \texttt{utf8}.

\latex detects the correct encoding with encoding specific characters (ä, ß, €) in the line with \cs{SelectInputMappings}. If you find that these characters are not printed correct in the editor reenter these characters. If your keyboard does not allow to enter ä and ß try at least if the euro character € is sufficient to detect an encoding. 

If file names may have encoding specific characters the encoding of the operating system must be defined as well. Therefore the option \option{filenameencoding} should be configured for either \texttt{latin1} or \texttt{utf8}. Both should cover most demands.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Configure the document}
\label{sec:doc:config:latex}
The template is configured by default for language English with double-sided printing and chapters for the highest section level. Suppose you want to configure it instead for German texts with single-sided printing and Sections as the main level:

\begin{itemize}
\item The demand of sections as the main level means that neither a book or report like document is intended, but instead an article like document with only few pages that do not require a substantial differentiation with chapters.

This is realized by changing the document class to \option{scrartcl} (main file at the \cs{documentclass} definition). The default class in this template is \option{scrbook}, which should not be changed for documents such as bachelor, master and phd thesis.
%
\item The language of the text is chosen in the options of the documentclass. The default language is \option{english}. The setting for new German orthography is \option{ngerman}. Other language options are documented in the babel documentation: \href{http://mirrors.ctan.org/macros/latex/required/babel/babel.pdf}{babel.pdf}
%
\item The double vs. single side printing is a bit more hidden in the file \file{preamble/style.tex} under the section \emph{Page Layout Options}. To change to single side printing change the option \option{twoside} from \texttt{true} to \texttt{false}.
\end{itemize}

Other configurations of \latex are listed in \cref{chap:doc:faq}. \Cref{sec:doc:faq:style} lists most of the settings with their according options and locations in the template files. Some are further explained, 
for example the setting of the line spacing in \cref{sec:doc:faq:spacing}.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Start Writing your content}

At the beginning, the documents in the front and the end should be adapted to the documents content. For example the users name, institution, title can be inserted in \path{content/0-title}. This file comes with other content files before the actual document start with the front pages (\emph{frontmatter}):
%
\begin{itemize}
\item \path{content/Z-GlossaryEntries.tex}
\item \path{content/0-title},
\item \path{content/0-Abstract}
\item \path{content/Z-Declaration.tex}.
\end{itemize}
%

Next the main files should be renamed according to the chapter organization of the document. The following files are preconfigured for the main content (\emph{mainmatter}). 
%
\begin{itemize}
\item \path{content/0-Introduction}
\item \path{content/1-Theory}
\item \path{content/2-Experiments}
\item \path{content/3-Results}
\item \path{content/4-Summery}
\end{itemize}
%
If certain automatic generated lists such as the index, a glossary or others are not needed these should be disabled in the main file.
%
%
And at the end of the document files are included that belong to the appendix. %
\begin{itemize}
\item \path{content/Z-Appendix.tex}
\item \path{content/Z-Publications.tex}
\item \path{content/Z-CV.tex}
\item \path{content/Z-Thanks.tex}
\end{itemize}
%
The naming scheme of these files and their loading mechanism is further explained in \cref{sec:doc:faq:documents}.

From this point on there is not much more to be done, except writing down the content for the project this template is supposed to be used for.



%% =========================================================================
\chapter{Settings, locations, questions and solutions}
\label{chap:doc:faq}
This chapter contains all sorts of answers to typical questions, locations of settings and general solutions with \latex. Further examples of the possibilities of this template are shown with code and examples in \cref{part:demo}.

%This list of possible questions and answers is neither complete nor a list of typical questions (which I have not statistics for). It is just a list of question that this template can provide a solution for or questions that can be answered with this documentation in \cref{part:demo}.

% -------------------------------------------------------------------------
\section{Layout and style configuration}
\label{sec:doc:faq:style}

This template tries to differentiate clearly between functionality (package loading) and configuration of the layout and the packages. The first is done primarily in file \file{preamble/packages.tex} the latter mainly in file \file{preamble/style.tex}. Nevertheless this separation cannot be fully realized because many options must be specified with the loading of the package.

The following tables \ref{tab:doc:configurationlinks} and \ref{tab:doc:configurationfiles} show links to the most important configuration options and their location in the template files.

Most question of the kind \enquote{how do I change the layout of \ldots} can be solved by locating the relevant settings in these tables and playing with their values.
% .........................................................................
 { % start a group 
 \colorlet{tabledarkheadcolor}{black!60}
  % style  
  \small\renewcommand{\arraystretch}{1.4}\sffamily
  % required if floatrow is loaded
  \IfDefined{floatsetup}{\floatsetup[longtable]{font={sf,small}}} 
  % the table
  \begin{longtabu} to \textwidth%
  {X[2,l]>{\ttfamily}X[2,l]X[2,l]}
\captionabove{Links to locations for configurations of the document layout}
\label{tab:doc:configurationlinks}
 \\
  \hline
  \taburowcolors 1{tabledarkheadcolor .. tabledarkheadcolor}
  \upshape
  \sffamily\textcolor{white}{Setting} &
  \sffamily\textcolor{white}{Option/Value}  &
  \sffamily\textcolor{white}{Location} \\ \hline
\endfirsthead
  \hline
  \upshape
  \sffamily\textcolor{white}{Setting} &
  \sffamily\textcolor{white}{Option/Value}  &
  \sffamily\textcolor{white}{Location} \\ \hline
\endhead
  \hline 
  \taburowcolors 1{white .. white}
  \multicolumn{3}{r}{\emph{continued on next page \ldots}}
\endfoot
  \hline
\endlastfoot
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Options in file: \file{LaTeXTemplate.tex}} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
paper size & paper=a4 & 
	option of \hyperref[sec:main:class]{\cs{documentclass}} \\
language   & english  & 
	option of \hyperref[sec:main:class]{\cs{documentclass}} \\
font size  & fontsize=11pt & 
	option of \hyperref[sec:main:class]{\cs{documentclass}} \\
color of hyperlinks & \bs{}UseDefinition\arg{Target}\arg{Web} & 		
	Section: \hyperref[sec:preamble:configuration]{Configurations} \\
page layout in the pdf view & pdfpagelayout	& 
	Section: \hyperref[sec:preamble:configuration]{Configurations} \\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Options in file: \file{preamble/packages.tex}} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
equation position & fleqn & 
	Section: \hyperref[sec:packages:math]{PackagesMath} \\
quotation style   & german=quotes & 
	Section: \hyperref[sec:packages:quotes]{PackagesQuotes} \\
citation style    & style=alphabetic & 
	Section: \hyperref[sec:packages:bibliography]{PackagesCitation} \\
bibliography backend & backend=biber & 
	Section: \hyperref[sec:packages:bibliography]{PackagesCitation} \\
header and footer & automark,komastyle &
	Section: \hyperref[sec:packages:headfoot]{PackagesHeadFoot} \\
backlinks in the bibliography & backref=page & 
	Section: \hyperref[sec:packages:pdf]{PackagesPDF} \\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Settings and options in file: \file{preamble/style.tex}} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
url font 		& \cs{urlstyle}\arg{tt} &  
	Section: \hyperref[sec:style:text]{StyleText} \\
threshold for \cs{blockquote} & \cs{SetBlockThreshold}\arg{2} &
	Section: \hyperref[sec:style:quotes]{StyleQuotes} \\
numbering of figures & \cs{numberwithin}\arg{figure} & 
 	Section:  \hyperref[sec:style:captions]{StyleCaptions} \\
paragraph skip or indentation & parskip=false &  
	Section: \hyperref[sec:style:layout:paragraph]{StyleParagraph} \\
line spacing 	& \cs{onehalfspacing} &  
	Section: \hyperref[sec:style:layout:linespacing]{StyleLineSpacing} \\
size of text body 	& DIV=11 & 
	Section: \hyperref[sec:style:layout:page]{StylePageLayout} \\
binding correction 	& BCOR=10mm & 
	Section: \hyperref[sec:style:layout:page]{StylePageLayout} \\
single/two side layout & twoside=true & 
	Section: \hyperref[sec:style:layout:page]{StylePageLayout} \\
separate title page & titlepage=true & 
	Section: \hyperref[sec:style:titlepage]{StyleTitlepage} \\
sections numbering depth & \cs{setcounter}\arg{secnumdepth}\arg{2} & 
 	Section: \hyperref[sec:style:headings]{StyleHeadings} \\
headings size 	& headings=small &  
	Section: \hyperref[sec:style:headings]{StyleHeadings} \\
chapter prefix 	& headings=nochapterprefix & 
	Section: \hyperref[sec:style:headings]{StyleHeadings} \\
heading fonts  	& \cs{setkomafont}\arg{sectioning} & 
	Section: \hyperref[sec:style:headings:fonts]{StyleHeadingsFonts} \\
toc numbering depth & \cs{setcounter}\arg{tocdepth}\arg{3} & 
	Section: \hyperref[sec:style:toc]{StyleLayoutTOC} \\
bibliography in TOC & bibliography=totoc & 
	Section: \hyperref[sec:style:toc]{StyleLayoutTOC} \\
index in TOC 	& index=nottotoc & 
	Section: \hyperref[sec:style:toc]{StyleLayoutTOC} \\
LOF in TOC 	& listof=notoc & 
	Section: \hyperref[sec:style:toc]{StyleLayoutTOC} \\
%
\end{longtabu}
} % close the group
% .........................................................................
{ % start a group 
 \colorlet{tabledarkheadcolor}{black!60}
  % style  
  \small\renewcommand{\arraystretch}{1.4}\sffamily
  % required if floatrow is loaded
  \IfDefined{floatsetup}{\floatsetup[longtable]{font={sf,small}}} 
  % the table
  \begin{longtabu} to \textwidth%
  {X[2,l]X[3,l]}
\captionabove{Links to files for package configurations}
\label{tab:doc:configurationfiles} \\
  \hline
  \taburowcolors 1{tabledarkheadcolor .. tabledarkheadcolor}
  \upshape
  \sffamily\textcolor{white}{Package / Topic} &
  \sffamily\textcolor{white}{File}  \\ \hline
\endfirsthead
  \hline
  \upshape
  \sffamily\textcolor{white}{Package / Topic} &
  \sffamily\textcolor{white}{File}  \\ \hline
\endhead
  \hline 
  \taburowcolors 1{white .. white}
  \multicolumn{2}{r}{\emph{continued on next page \ldots}}
\endfoot
  \hline
\endlastfoot
%
\taburowcolors 2{tablebodycolor .. tablerowcolor}
siunitx & \file{preamble/style-siunitx.tex} \\
pgfplots & \file{preamble/style-pgfplots.tex} \\
biblatex & \file{preamble/style-biblatex.tex} \\
biblatex style & \file{preamble/style-biblatex-alpha.tex} \\
caption, subcaption, subfig  & \file{preamble/style-caption.tex} \\
floatrow & \file{preamble/style-floatrow.tex} \\
imakeidx & \file{preamble/style-index.tex} \\
glossaries & \file{preamble/style-glossaries.tex} \\
listings & \file{preamble/style-listings.tex} \\
geometry & \file{preamble/style-geometry.tex} \\
scrpage2 & \file{preamble/style-scrpage2.tex} \\
titlesec & \file{preamble/style-titlesec.tex} \\
hyperref & \file{preamble/style-hyperref.tex} \\
%
\end{longtabu}
} % close the group
% .........................................................................

Some of the options shown in the previous tables are further discussed in the following sections.

% -------------------------------------------------------------------------
\section{Magic comments}
\label{sec:doc:magiccomments}

The \emph{magic comments} discussed in this section present a configuration for the editor, which is saved inside the \latex file (at the beginning). They allow to define the program (pdflatex), the main file, the encoding (utf8) and the spell checking. 

They were originally developed within the editor \href{http://pages.uoregon.edu/koch/texshop/index.html}{TexShop} and are used by the editors \href{http://www.tug.org/texworks/}{TeXWorks} and \href{http://texstudio.sourceforge.net/}{TeXStudio}.
%
The following information on these magic comments is based on these publications:
%
\begin{itemize}
\item \href{http://www.texdev.net/2011/03/24/texworks-magic-comments/} %
      {texworks magic comments (by Joseph Wright)}
\item \href{http://ftp.ctex.org/pub/tex/tools/editors/TeXworks/manual.pdf}%  
      {TeXworks manual}
\end{itemize}
%
All these comments have in common that they have to be put in the beginning of each file and have to begin with \enquote{\texttt{\% !TeX}}. 

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Root file}
\begin{latexcode}
% !TeX root = manual.tex
\end{latexcode}
%
Defines the main file for typesetting (often called the \emph{master file}). This enables a very basic project management by defining the master file for each file of the project.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Program}
\begin{latexcode}
% !TeX program = pdflatex
\end{latexcode}
%
Chooses the engine for compilation. Possible values are \texttt{pdflatex}, \texttt{LuaLaTeX}, \texttt{XeTeX}, \texttt{LaTeX} (and possibly others). Note that the engine name inserted is case-insensitive.

Unless your code is set up for a different engine and the selection of packages and fonts loaded is adapted for that engine the default should be kept as \texttt{pdflatex}. 

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Spell checking}
\label{sec:doc:magiccomments:spell}

\begin{latexcode}
% !TeX spellcheck = en_US
\end{latexcode}
%
Specifies the spell checking language in the editor for that file. 
The language of course needs to be installed for the editor!
%
Selection of some languages:
\begin{itemize}[noitemsep]
\item \texttt{en\_GB} - English (Great Britain)
\item \texttt{en\_US} - English (US)
\item \texttt{de\_DE} - German (Germany)
\item \texttt{fr\_FR} - French (France)
\end{itemize}

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Encoding}
\label{sec:doc:magiccomments:encoding}

\begin{latexcode}
% !TeX encoding = UTF-8
\end{latexcode}
%
Sets the file encoding for the current file. The default in current editors is UTF-8.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{bibliography tool}
\label{sec:doc:magiccomments:bib}

\begin{latexcode}
% !BIB = biber
\end{latexcode}
%
The alternative is \texttt{bibtex}, which is no longer recommended and with this template
not supported! 

% -------------------------------------------------------------------------
\section{Selection of font(s)}
\label{sec:doc:faq:fonts}

The font selection is made in file \file{fonts/fonts.tex}. The standard font in this template is \emph{Latin Modern}. This selection is done for simplicity. It is the default \latex font and should be available in every distribution. If you prefer a different font you have a free choice out of many fonts that are installed on most systems and are available for free. See \cref{chap:doc:fonts} for a short overview. One should take care that for every roman font that a suitable sans serif font must be chosen as well.

% -------------------------------------------------------------------------
\section{Change of the page layout}
\label{sec:doc:faq:pagelayout}

Two packages are supported for the page layout. Package \package{typearea} is very easy to use and modify and gives well suited results for a thesis document. If however a much customized page layout is demanded the package \package{geometry} provides the abilities to implement the page layout.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Package typearea}
The page layout is by default set up with the package \package{typearea}, which is loaded automatically. It is configured with the \emph{DIV} parameter, which defines the amount of text on a page (the larger the more space for the text) and the \emph{BCOR} parameter, which defines the binding correction in millimeters. The basics of this layout mechanism is very well described in \href{http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguien.pdf}{scrguien.pdf}. The parameters are set up in file \file{preamble/style.tex}, see \cref{sec:style:layout:page}.

If the layout must be specified with very detailed parameters such as margin width, top and bottom space or exact amount of line numbers the package \package{geometry} is providing this functionality.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Package geometry}
This package provides \enquote{a flexible and easy interface to page dimensions} as stated in its documentation. One can set up every possible parameter and all unspecified dimensions are automatically determined by the package accordingly.

To enable this package it must be loaded in file \file{preamble/packages.tex}, see \cref{sec:packages:layout} and be configured in \file{preamble/style-geometry.tex}.

% -------------------------------------------------------------------------
\section{Change color of (hyper)links}
\label{sec:doc:faq:hyperlinks}
The hyperlinks are introduced by package \package{hyperref}. The colors are configured for the links in \file{preamble/style-hyperref.tex} and defined in \file{preamble/style.tex} (see \cref{sec:style:colors}). This template introduces a simple mechanism to switch between colored and black links (the latter for printing) using the command \cs{UseDefinition}. This is configured in the main file (see \cref{sec:preamble:configuration}).

% -------------------------------------------------------------------------
\section{Generation of tables}
\label{sec:doc:faq:tables}
See the large list of examples in \cref{sec:demo:tables} on using the environments \env{tabular}, \env{tabularx}, \env{tabu}, \env{table} and further for printing tabular material in principle and how to print beautiful tables.

% -------------------------------------------------------------------------
\section{Include, align and position graphics}
\label{sec:doc:faq:graphics}
See the large list of examples on using the \cs{includegraphics} command, the \env{figure} environment and further commands in \cref{sec:demo:figures}.

% -------------------------------------------------------------------------
\section{Draw graphics, diagrams and plots}
\label{sec:doc:faq:pgf}

This template relies on the packages \package{pgf}, \package{tikz} and \package{pgfplots} for the creation of diagrams and plots, see \cref{sec:demo:diagram}. The \package{pstricks} is neither supported nor tested with this template. It may or may not work together with this template.

% -------------------------------------------------------------------------
\section{Print code with line numbers and syntax highlighting}
\label{sec:doc:faq:listings}

Syntax highlighting within \latex is provided by the package \package{listings}. The syntax highlighting of this package is defined in file \file{preamble/style-listings.tex}.
Several styles are predefined:
\begin{labeling}{\ttfamily lstStyleFramed}
\item[\ttfamily lstStyleBase] basic code format
\item[\ttfamily lstStyleFramed] basic format with frame
\item[\ttfamily lstStyleCpp] style for C++ code
\item[\ttfamily lstStyleLaTeX] style for \latex code.
\end{labeling}
See \cref{sec:demo:listings} for examples.

% -------------------------------------------------------------------------
\section{One-half and double spacing}
\label{sec:doc:faq:spacing}

The line spacing is controlled by \package{setspace}. It is configured in file \file{preamble/style.tex} in the section \emph{StyleLineSpacing}. The code is shown in \cref{sec:style:layout:linespacing}.

% -------------------------------------------------------------------------
\section{Line numbering}
\label{sec:doc:faq:linenumbering}

The package required for line numbering is not loaded by default, but it can be enabled in \file{preamble/packages.tex}, see \cref{sec:packages:misc}. Furthermore the command \cs{linenumbers} must be executed. This must be enabled in \file{preamble/makeCommands.tex}.

% -------------------------------------------------------------------------
\section{Creation of a bibliography and citations styles}
\label{sec:doc:faq:biblatex}

This template relies for the creation of a bibliography and the related citations styles entirely on the package \package{biblatex}. Any historic solution which was popular before \texttt{biblatex} came out is incompatible.
For all further information refer to the official documentation \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf}{biblatex.pdf}.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Define bibliography (bib) files}
The file format is still the well-known BibTeX format (file ending .bib). These files are loading in the preamble before the beginning of the document, see \cref{sec:preamble:bibfiles} with the command \cs{addbibresource}. The file name must be written without the \texttt{.bib} file extension.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Define the citation style}
The package is loaded in file \file{preamble/packages.tex} and the style for the display of the bibliography and the citations is defined as an option of the package. The default style is \emph{alphabetic}. However, several other styles exists, see \cref{sec:packages:bibliography}, the package documentation and the website \href{http://www.ctan.org/tex-archive/macros/latex/exptl/biblatex-contrib}{biblatex-contrib} for a list of further styles. 

Furthermore the basic properties of the package are configured in file \file{preamble/style-biblatex.tex} whereas the style is modified for an \emph{alpha} style in file \file{preamble/style-biblatex-alpha.tex}.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{Ways to insert citations}

Citations are inserted basically with the \cs{cite} command. Further possibilities are shown in \cref{sec:demo:biblatex}. For a complete list refer to the official documentation of \package{biblatex}. If the citations are supposed to be placed in the footnotes this is realized with the parameter \option{autocite} in file 
\file{preamble/style-biblatex.tex}.

% -------------------------------------------------------------------------
\section{Quoting and citing text}
\label{sec:doc:faq:quotes}
The default quotation environments of \latex (quote and quotation) are enhanced by the commands \cs{enquote} and \cs{blockquote} which are much better suited for very simple to very complex quotations with citations.
See \cref{sec:demo:quote} for examples of its usage.

% -------------------------------------------------------------------------
\section{Tables of contents and other tables}
\label{sec:doc:faq:toc}

The contents and the style of the table of contents are defined in file \file{preamble/style.tex}, see \cref{sec:style:toc}.

% -------------------------------------------------------------------------
\section{Index, glossary and other lists}
\label{sec:doc:faq:index}

This template can handle an index and the creation of a glossary, an acronym list and a symbol list which are created using the package \package{glossaries}.

The style settings for these list are loaded in file \file{preamble/style-index.tex} and file \file{preamble/style-glossaries.tex}.

They are printed in the main file, see \cref{sec:document:glossaries}.

% -------------------------------------------------------------------------
\section{Hyphenation}
\label{sec:doc:faq:hyphenation}

The hyphenation is enabled by default in \latex. In order to function correct the language must be specified in the document class, see \cref{sec:main:class}. Additional hyphenation patterns are added to file \file{content/hyphenation.tex}.

In the text itself hyphenation marks can be added. These are however language specific. For German texts an overview is shown in \href{http://de.wikibooks.org/wiki/LaTeX-Wörterbuch:_Silbentrennung}{http://de.wikibooks.org/}.

% -------------------------------------------------------------------------
\section{Document management}
\label{sec:doc:faq:documents}

The default content files of this template are located in the path \path{content} and named:

\begin{itemize}[noitemsep]
\item \path{content/title}
\item \path{content/0-Abstract} 
\item \path{content/0-Introduction}
\item \path{content/1-Theory}
\item \path{content/2-Experiments}
\item \path{content/3-Results}
\item \path{content/4-Summery}
\item \path{content/Z-Appendix.tex}
\item \path{content/Z-Publications.tex}
\item \path{content/Z-CV.tex}
\item \path{content/Z-Thanks.tex}
\item \path{content/Z-Declaration.tex}
\end{itemize}

The prefix is chosen as numbers for all main content files in the sequence in which the chapters are loaded and with a prefix \texttt{Z-} for all minor important files that mostly come after the main content. This naming scheme thus shows the files in the order of their appearance in the resulting document.

To speed up the compile times it is recommended to include only those chapters, on which is currently being worked on, into the compilation.
This is realized with \latex using the command \cs{includeonly}. This list contains all files loaded with \cs{include} that shall be included in the current compilation. All information on those files not included into the compilation, such as labels, is nevertheless included. This only requires that each file was at least once included in the compilation.

% -------------------------------------------------------------------------
\section{Creation of a minimal working example}
\label{sec:doc:faq:mwe}

This template is complex in terms of its division in different files that makes it rather difficult to track a problem. Due to the deactivatable code section created with the command \cs{DefineTemplateSection} this can be even easier than in any other large \latex project.

In order to ask people for a solution to a problem with \latex it is generally expected to provide a minimum working example. That means a single file \latex complete document that illustrates the problem. `Complete’ means that it must contain a document class and the document environment and the relevant code inside the document environment. It however must not contain any package or code that does not contribute to the problem.

In order to create a minimum document from this template it is absolutely necessary to copy the whole document code including all sub folders. If these contain too many images these can be left out. The copy is essential, because next most files are going to be modified or deleted.

Now first remove or comment out all chapter files that do not contribute to the error. If it is an error in the preamble, you can as well comment out everything in the document environment.

Next try to reduce the code in you remaining content file to the part that creates the error.

To check if the problem is in \file{preamble/style.tex} or if this file contributes to the problem comment out \file{preamble/style.tex}. If the error remains do the same for \file{preamble/packages.tex}. This could however introduce further errors because functionality gets lost. You can however check each section in this file separately or disable them from bottom to top by changing the section created with \cs{DefineTemplateSection} to \texttt{false}. The same can also be done for \file{preamble/style.tex}.

If the code section(s) in \file{preamble/packages.tex} or \file{preamble/style.tex} that generates the error is identified copy all these parts to the main document and remove the loading of these files. Note, that in cases of incompatible packages it could be more than a single code section that contributes to the error. If still files are included in the main file remove them or copy their code to the main file if necessary. As a result all code should not reside in the main file. From this point it should be able to remove all packages, all options and all remaining content that do not contribute to the problem. As a result the minimum working example is ready.

Typically most self-created errors are already found while processing these procedure to track down the problem. If not a good place to ask for further help is \href{http://tex.stackexchange.com}{tex.stackexchange.com}.

Further reading on how to generate a minimum working example can be found at:
\begin{itemize}
\item \href{http://meta.tex.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-example-what-is-that}{http://meta.tex.stackexchange.com}
%
\item \href{http://www.faulhammer.org/mini-en.pdf}{What is a minimal working example?}
%
\item \href{http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/minexample.pdf}{Creating a LaTeX Minimal Example}
%
\item \href{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl}{How to make a minimum example}
\end{itemize}

%% =========================================================================
\chapter{Known problems}
\label{chap:doc:problems}

This chapter provides a collection a known warnings and possible errors with an assessment of the problem.

% -------------------------------------------------------------------------
\section{Warnings}

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{scrbook: Usage of package `titlesec' together with a KOMA-Script class is not recommended}

The \package{titlesec} is not compatible with KOMA-Script classes as in
detail described in the warning message. Unless these features of KOMA-Script
are not required it should cause no problem to load both together. 

\package{titlesec} is used in this template to redefine the appearance of 
chapter and part headings as well as the spacing before and after 
sections in different levels.

\begin{verbatim}
Class scrbook Warning: Usage of package `titlesec' together
(scrbook)              with a KOMA-Script class is not recommended.
(scrbook)              I'd suggest to use the package only
(scrbook)              if you really need it, because it breaks several
(scrbook)              KOMA-Script features, i.e., option `headings' and
(scrbook)              the extended optional argument of the section
(scrbook)              commands .
(scrbook)              Nevertheless, using requested
(scrbook)              package `titlesec' on input line 824.
\end{verbatim}


% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{biblatex: No file \texorpdfstring{\argument{filename}}{filename}.bbl}

If you have not executed \texttt{biber} you will get the following warning by
\package{biblatex}. Simply run you bibliography tool to get create bbl file.

\begin{verbatim}
Package biblatex Info: Trying to load bibliographic data...
Package biblatex Info: ... file '<filename>.bbl' not found.

No file <filename>.bbl.
\end{verbatim}

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%\subsection{glossaries: No \cs{printglossary} or \cs{printglossaries} found.}
%
%\begin{verbatim}
%Package glossaries Warning: No \printglossary or \printglossaries found.
%This document will not have a glossary.
%\end{verbatim}

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{tocstyle: This is an alpha version}

Package \package{tocstyle} prints out the following warning:
%
\begin{verbatim}
Package tocstyle Warning: THIS IS AN ALPHA VERSION!
(tocstyle)                USAGE OF THIS VERSION IS ON YOUR OWN RISK!
(tocstyle)                EVERYTHING MAY HAPPEN!
(tocstyle)                EVERYTHING MAY CHANGE IN FUTURE!
(tocstyle)                THERE IS NO SUPPORT, IF YOU USE THIS PACKAGE!
(tocstyle)                Maybe it would be better, not to load this package.
\end{verbatim}
%
This package is now in use with this template for several years (of development of the template before its release) and so far no problem has been found. Therefore I do not expect any problem because of this package and consider this warning to be ignorable.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{hypennat: You have used the htt option}

Package \package{hypennat} prints out the following warning:
%
\begin{verbatim}
Package hyphenat Warning: *******************************
(hyphenat)                * You have used the htt option.
(hyphenat)                * You are likely to get many Font Warning messages.
(hyphenat)                * These can usually be ignored.
(hyphenat)                *******************************.
\end{verbatim}
%
It can be ignored as already stated by the package warning.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{pageslts: Package pdfpages detected.}

Package \package{hypennat} warns about the use of package \package{pdfpages}:
%
\begin{verbatim}
Package pageslts Warning: Package pdfpages detected.
(pageslts)                Using hyperref with pdfpages can cause problems. See
(pageslts)                ftp://ftp.ctan.org/tex-archive/
(pageslts)                macros/latex/contrib/pax/
(pageslts)                for project pax (PDFAnnotExtractor)..
\end{verbatim}
%
This can be savely ignored, see \url{http://tex.stackexchange.com/questions/73767/warning-about-pdfpages-with-hyperref} for a discussion.

% -------------------------------------------------------------------------
\section{Errors}

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsection{No room for new write}
\label{sec:problems:write}

TeX uses output registers to write to files. Unfortunately TeX was designed to use only 16 of such registers of which the output registers 0, 1 and 2 are already used by (La)TeX itself. The remaining registers are consumed by additional packages that need to write to external files.

If you come across this error you have reached a fixed limitation of the TeX engine and there is nothing that can directly be done about this error, as you cannot extend the number of available registers without extending TeX itself.

Typical packages that consume output registers are:
\begin{itemize}
\item glossaries (acronym list, symbol list, glossary)
\item biblatex (bibliography)
\item listings (list of listings)
\item imakeidx (index)
\item fancyvrb 
\item pgf/tikz
\item pgf/tikz with \texttt{external} option
\item titletoc
\end{itemize}

The most promising solution about this problem is to reduce the number of used output registers. So for example if no index is required (package imakeidx) and the package fancyvrb is not needed both could be commented out and instead the list of listings could be activated.

The approach of this template is to use either the package \package{morewrites} or \package{scrwfile}, which hook at the lowest level (\TeX primitives) to solve this problem. These packages however might cause problems since they modify \LaTeX at a very basic level and can thus cause incompatibilities. For \package{scrwfile} it is know to that \package{titletoc} does no longer work. If however \package{titletoc} is not required \package{scrwfile} is recommended.
These packages are loaded in \file{preamble/packages-SolutionsNoRoomForNewWrite.tex}.

Further information about this issue can be found at
\begin{itemize}
\item \href{http://tex.stackexchange.com/questions/15665/making-efficient-use-of-writes}{tex.stackexchange.com}
\item \href{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=noroom}{UK FAQ List}
\end{itemize}

%% =========================================================================
\chapter{Short fonts overview}
\label{chap:doc:fonts}

The information given here is only a subset of the whole story. A more complete catalogue on \latex fonts can be found at \href{http://www.tug.dk/FontCatalogue/}{http://www.tug.dk/FontCatalogue/}.

The fonts listed in the following sections are not only a list of very common fonts, but also those that are supported within this template. If this should not be the case the commands that are necessary to load the font is provided, so that the font loading can be integrated in this template. The first section (\ref{sec:doc:fonts:free}) lists most free fonts, which can be expected to be installed in a complete modern \latex distribution. The second section (\ref{sec:doc:fonts:commercial}) is about packages for commercial fonts. These packages are available for free, however the fonts itself are not. The last section (\ref{sec:doc:fonts:math}) is about fonts with math support.

% -------------------------------------------------------------------------
\section{Free fonts}
\label{sec:doc:fonts:free}

 { % start a group 
 \colorlet{tabledarkheadcolor}{black!60}
  % style  
  \small\renewcommand{\arraystretch}{1.4}\sffamily
  % required if floatrow is loaded
  \IfDefined{floatsetup}{\floatsetup[longtable]{font={sf,small}}} 
  % the table
  \begin{longtabu} to \textwidth{X[1,l]>{\ttfamily}X[2,l]X[1,l]}
% \captionabove{longtabu tabular with X columns} \\
  \hline
  \taburowcolors 1{tabledarkheadcolor .. tabledarkheadcolor}
  \upshape
  \sffamily\textcolor{white}{Font} &
  \sffamily\textcolor{white}{Loading command} &
  \sffamily\textcolor{white}{Family} \\ \hline
\endfirsthead
  \hline
\upshape
  \sffamily\textcolor{white}{Font} &
  \sffamily\textcolor{white}{Loading command} &
  \sffamily\textcolor{white}{Family} \\ \hline
\endhead
  \hline 
  \taburowcolors 1{white .. white}
  \multicolumn{3}{r}{\emph{continued on next page \ldots}}
\endfoot
  \hline
\endlastfoot
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Font families} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
Latin Modern   & \bs{}usepackage\arg{lmodern}  & (see below) \\
Bera           & \bs{}usepackage\arg{bera}     & (see below) \\
CM-Bright      & \bs{}usepackage\arg{cmbright} & (see below) \\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Latin Modern font family} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
LM Roman   & \bs{}renewcommand\arg{\bs{}rmdefault}\arg{lmr}  & lmr  \\
LM Sans    & \bs{}renewcommand\arg{\bs{}sfdefault}\arg{lmss} & lmss \\
LM Mono    & \bs{}renewcommand\arg{\bs{}ttdefault}\arg{lmtt} & lmtt \\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Bera font family} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
Bera Serif	& \bs{}usepackage\arg{beraserif} & fve \\
Bera Sans	& \bs{}usepackage\arg{berasans}	 & fvs \\
Bera Mono	& \bs{}usepackage\arg{beramono}	 & fvm \\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{CmBright font family} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
CmBright Mono	& \bs{}renewcommand\arg{\bs{}ttdefault}\arg{cmtl} & cmtl \\
CmBright Sans	& \bs{}renewcommand\arg{\bs{}sfdefault}\arg{cmbr} & cmbr \\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Fonts in the PSNFSS collection (Type 1 postscript fonts)} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
Times		& \bs{}usepackage\arg{mathptmx}	& ptm \\
Helvetica	& \bs{}usepackage\arg{helvet}	& phv \\
Courier		& \bs{}usepackage\arg{courier}	& pcr \\
Palantino	& \bs{}usepackage\arg{mathpazo}	& pplx, pplj \\
Charter		& \bs{}usepackage\arg{charter}	& bch \\
Bookman		& \bs{}usepackage\arg{bookman}	& pbk \\
%Utopia		& \bs{}usepackage\arg{utopia}	& put \\
New Century Schoolbook	& \bs{}usepackage\arg{newcent}	& pnc \\
Avantgarde	& \bs{}usepackage\arg{avantgar}	& pag \\
Zapf Chancery	& \bs{}usepackage\arg{chancery}	& pzc \\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Fonts supplied by the  \href{http://www.tug.org/fonts/getnonfreefonts/}{getnonfreefonts} script} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
Arial (URW) 	& \bs{}usepackage\arg{uarial} 				& ua1 \\
Classico (URW) 	& \bs{}renewcommand\arg{\bs{}sfdefault}\arg{uop} 	& uop \\
DayRoman  		& \bs{}renewcommand\arg{\bs{}rmdefault}\arg{dayrom} & dayrom\\
GaramondNo8 (URW) 	& \bs{}renewcomamnd\arg{\bs{}rmdefault}\arg{ugm} & ugm\\
LetterGothic (URW) 	& \bs{}usepackage\arg{ulgothic} & ulg\\
Luxi Mono		& \bs{}usepackage\arg{luximono}		& ul9\\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Other Type 1 postscript fonts} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
Fourier		& \bs{}usepackage\arg{fourier}	& futm \\
\end{longtabu}
} % close the group

% -------------------------------------------------------------------------
\section{Commercial fonts}
\label{sec:doc:fonts:commercial}

In order to use these fonts for documents that shall be published it is absolutely essential to own a license. Most fonts can only be obtained by buying these fonts; others may be installed on the computer by programs. Nevertheless its use is restricted unless a license for using these fonts is owned!

If the fonts are available they need to be renamed and installed using the according manuals provided by \href{http://cq131a.de/fonts.html}{Walter Schmidt}

 { % start a group 
 \colorlet{tabledarkheadcolor}{black!60}
  % style  
  \small\renewcommand{\arraystretch}{1.4}\sffamily
  % required if floatrow is loaded
  \IfDefined{floatsetup}{\floatsetup[longtable]{font={sf,small}}} 
  % the table
  \begin{longtabu} to \textwidth{X[1,l]>{\ttfamily}X[2,l]X[1,l]}
% \captionabove{longtabu tabular with X columns} \\
  \hline
  \taburowcolors 1{tabledarkheadcolor .. tabledarkheadcolor}
  \upshape
  \sffamily\textcolor{white}{Font} &
  \sffamily\textcolor{white}{Loading command} &
  \sffamily\textcolor{white}{Family} \\ \hline
\endfirsthead
  \hline
\upshape
  \sffamily\textcolor{white}{Font} &
  \sffamily\textcolor{white}{Loading command} &
  \sffamily\textcolor{white}{Family} \\ \hline
\endhead
  \hline 
  \taburowcolors 1{white .. white}
  \multicolumn{3}{r}{\emph{continued on next page \ldots}}
\endfoot
  \hline
\endlastfoot
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Serif fonts} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
Adobe Optima	& \bs{}usepackage\arg{optima}	& pop, popm \\
Adobe Aldus		& \bs{}renewcommand{\bs{}rmdefault}\arg{pasx}	& pasx, pasj \\
Adobe Garamond	& \bs{}usepackage\arg{xagaramon}	& padx, padj \\
Adobe Stempel Garamond & \bs{}renewcommand\arg{\bs{}rmdefault}\arg{pegx} & 	pegx, pegj \\
Adobe Melior	& \bs{}renewcommand\arg{\bs{}rmdefault}\arg{pml}	& pml \\
Adobe Minion	& \bs{}usepackage\arg{minion} &	pmnx, pmnj \\
Adobe Sabon		& \bs{}renewcommand\arg{\bs{}rmdefault}\arg{psbx} & psbx, psbj \\
Adobe Times		& \bs{}renewcommand\arg{\bs{}rmdefault}\arg{ptmx} & ptmx, ptmj \\
Adobe Rotis Serif	& \bs{}renewcommand\arg{\bs{}rmdefault}\arg{pro} & pro \\
Adobe Rotis Semi-Serif	& \bs{}renewcommand\arg{\bs{}rmdefault}\arg{pr1} & pr1 \\
Linotype Meridien		& \bs{}renewcommand\arg{\bs{}rmdefault}\arg{lmd} & lmd \\
Linotype ITC Charter	& \bs{}renewcommand\arg{\bs{}rmdefault}\arg{lch} & lch \\
%
\taburowcolors 1{tablesubheadcolor .. tablesubheadcolor}
\multicolumn{3}{l}{Sans serif fonts} \\
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
Adobe Frutiger	& \bs{}usepackage\arg{frutiger}	& pfr \\
Adobe Futura	& \bs{}usepackage\arg{futura}	& pfu \\
Adobe Gill Sans	& \bs{}usepackage\arg{gillsans}	& pgs \\
Adobe Myriad	& \bs{}renewcommand\arg{\bs{}sfdefault}\arg{pmy}	& pmy, pmyc \\
Adobe Syntax	& \bs{}usepackage\arg{asyntax}	& psx \\
Adobe Rotis Sans & \bs{}renewcommand\arg{\bs{}sfdefault}\arg{pr4}	& pr4 \\
Adobe Rotis Semi-Sans & \bs{}renewcommand\arg{\bs{}sfdefault}\arg{pr3}	& pr3 \\
Linotype ITC Officina Sans	& \bs{}renewcommand\arg{\bs{}sfdefault}\arg{lo9}	& lo9 \\
\end{longtabu}
} % close the group

% -------------------------------------------------------------------------
\section{Fonts with math support}
\label{sec:doc:fonts:math}

The following table lists font packages that do not only load the font but also the according math font. The only exceptions are the packages \package{mathdesign}, \package{MnSymbol} and \package{MdSymbol}, which only load a math font.

Note that the package \package{MnSymbol} and \package{MdSymbol} have severe restrictions on the loading order and incompatible packages, which is taken care of in this template.

The package \package{eulervm} is special in the respect that it does not provide a math font for a specific roman font, but instead provides a math font that fits well to many common (commercial) serif fonts such as Adobe Aldus, Adobe Melior, Adobe Sabon and others for which no \latex math font support exists.

 { % start a group 
 \colorlet{tabledarkheadcolor}{black!60}
  % style  
  \small\renewcommand{\arraystretch}{1.4}\sffamily
  % required if floatrow is loaded
  \IfDefined{floatsetup}{\floatsetup[longtable]{font={sf,small}}} 
  % the table
  \begin{longtabu} to \textwidth{X[l,2]>{\ttfamily}X[l,3]}
% \captionabove{longtabu tabular with X columns} \\
  \hline
  \taburowcolors 1{tabledarkheadcolor .. tabledarkheadcolor}
  \upshape
  \sffamily\textcolor{white}{Font} &
  \sffamily\textcolor{white}{Loading command}\\ \hline
\endfirsthead
  \hline
\upshape
  \sffamily\textcolor{white}{Font} &
  \sffamily\textcolor{white}{Loading command}\\ \hline
\endhead
  \hline 
  \taburowcolors 1{white .. white}
  \multicolumn{2}{r}{\emph{continued on next page \ldots}}
\endfoot
  \hline
\endlastfoot
%
\taburowcolors 2{tablebodycolor .. tablerowcolor}
%
Charter (Bitstream) & \bs{}usepackage[bitstream-charter]\arg{mathdesign} \\
% Computer Concrete	& \bs{}usepackage\arg{concmath} \\
% Computer Modern Bright & \bs{}usepackage\arg{cmbright}\\
Garamond (URW)		& \bs{}usepackage[urw-garamond]\arg{mathdesign} \\
Latin Modern    	& \bs{}usepackage\arg{lmodern} \\
New Century Schoolbook & \bs{}usepackage\arg{fouriernc} \\
Times (Nimbus Roman (URW))& \bs{}usepackage\arg{mathptmx} \\
Palatino			& \bs{}usepackage[sc]\arg{mathpazo} \\
Utopia (Fourier) 	& \bs{}usepackage\arg{fourier} \\
Adobe Minion		& \bs{}usepackage\arg{MnSymbol} \\
Adobe Myriad		& \bs{}usepackage\arg{MdSymbol} \\
Euler				& \bs{}usepackage\arg{eulervm} \\
\end{longtabu}
} % close the group

% -------------------------------------------------------------------------
\section{Font examples}
\label{sec:doc:fonts:examples}

The following pages show examples of several font combinations that were created with this template code. This selection was done with care on similar x-heights and glyph widths, but since this selection was not done by a font expert the resulting combinations might still be not perfect. Further reading on the topic of typeface combinations can be found here: 
\href{http://www.smashingmagazine.com/2010/11/04/best-practices-of-combining-typefaces/}{http://www.smashingmagazine.com/}. The clear exception is the combination of Times with Arial and Courier. This combination is shown because it is widely used but absolutely not recommendable.

\begin{itemize}
\item \hyperref[sec:doc:fonts:Latin Modern Family]{Latin Modern Family}
\item \hyperref[sec:doc:fonts:Charter-Bera Sans-Luxi Mono]{Charter, Bera Sans, Luxi Mono}
\item \hyperref[sec:doc:fonts:Garamond-Bera Sans-Luxi Mono]{Garamond, Bera Sans, Luxi Mono}
\item \hyperref[sec:doc:fonts:Fourier-Latin Modern]{Fourier (Utopia), Latin Modern (Sans and Typewriter)}
\item \hyperref[sec:doc:fonts:Palantino-Arial-Courier]{Palantino, Arial, Courier} \\ Note that Palantino fits very well to Gill Sans, which however is a commercial font.
\item \hyperref[sec:doc:fonts:Times-Arial-Courier]{Times, Arial, Courier}
\end{itemize}

\cleardoublestandardpage

\phantomsection\label{sec:doc:fonts:Latin Modern Family}
\includepdf[pages=-,pagecommand=\thispagestyle{scrheadings}]%
	{fonts/fontsample - Latin Modern Family.pdf}
%
\phantomsection\label{sec:doc:fonts:Charter-Bera Sans-Luxi Mono}
\includepdf[pages=-,pagecommand=\thispagestyle{scrheadings}]%
	{fonts/fontsample - Charter-Bera Sans-Luxi Mono.pdf}
%
\phantomsection\label{sec:doc:fonts:Garamond-Bera Sans-Luxi Mono}
\includepdf[pages=-,pagecommand=\thispagestyle{scrheadings}] %
	{fonts/fontsample - Garamond-Bera Sans-Luxi Mono.pdf}
%
\phantomsection\label{sec:doc:fonts:Fourier-Latin Modern}	
\includepdf[pages=-,pagecommand=\thispagestyle{scrheadings}] %
	{fonts/fontsample - Fourier (Utopia)-Latin Modern (Sans and Typewriter).pdf}
%
\phantomsection\label{sec:doc:fonts:Palantino-Arial-Courier}
\includepdf[pages=-,pagecommand=\thispagestyle{scrheadings}] %
	{fonts/fontsample - Palantino-Arial-Courier.pdf}
%
\phantomsection\label{sec:doc:fonts:Times-Arial-Courier}	
\includepdf[pages=-,pagecommand=\thispagestyle{scrheadings}] %
	{fonts/fontsample - Times-Arial-Courier.pdf}
